package com.woniuxy.woniuticket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * Created by Wu xianbo on 2019/6/3
 */

@Configuration
public class SelfWebMvcConfig implements WebMvcConfigurer{

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("choose_seat.html").setViewName("choose_seat.html");
        registry.addViewController("details.html").setViewName("details.html");
        registry.addViewController("film_cinema.html").setViewName("film_cinema.html");
        registry.addViewController("index.html").setViewName("index.html");
        registry.addViewController("login.html").setViewName("login.html");
        registry.addViewController("regist.html").setViewName("regist.html");
        registry.addViewController("tickets.html").setViewName("tickets.html");
        /*搜索evan*/
        registry.addViewController("search.html").setViewName("search.html");
        registry.addViewController("addSchedule").setViewName("addSchedule");
        registry.addViewController("schedulemsg").setViewName("schedulemsg");
        registry.addViewController("schedule_msg").setViewName("schedule_msg");
        registry.addViewController("sendmsg").setViewName("sendmsg");
        registry.addViewController("moviemanager/managerschedule").setViewName("moviemanager/managerschedule");
        //registry.addViewController("moviesmsg").setViewName("moviesmsg");
        registry.addViewController("movieshow/msgmovie").setViewName("movieshow/msgmovie");
        registry.addViewController("problemFeedback.html").setViewName("problemFeedback.html");
        registry.addViewController("buy_vip1.html").setViewName("buy_vip1.html");
        registry.addViewController("demo.html").setViewName("demo.html");
        registry.addViewController("userinfo.html").setViewName("userinfo.html");

//        registry.addViewController("schedule/showschedule1").setViewName("demo.html");




    }

    /*用户订单页面需要引入的websocket*/
  /*  @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }*/

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/upload/**").addResourceLocations("file:E:/code620/woniuticket/target/classes/static/upload/");
// registry.addResourceHandler("/null/**").addResourceLocations("file:E:/code611/target/classes/null");

    }
}
